﻿@using admin.Model
@{
    ViewData["Title"] = "BookManage";
    Layout = "~/Views/Shared/_MainLayout.cshtml";
    var book = ViewData["bookList"] as List<Book>;
    var admin = ViewData["admin"] as Administrator;
}


<div class="header">

    <h1 class="page-title">图书管理</h1>
</div>

<ul class="breadcrumb">
    <li><a href="index.html">图书管理</a> <span class="divider">/</span></li>
    <li class="active">图书信息</li>
</ul>

<div class="container-fluid">
    <div class="row-fluid">

        <div class="btn-toolbar">
            <button class="btn btn-primary"><i class="icon-plus"></i> 增加图书</button>
            <button class="btn">删除图书</button>
            <button class="btn">修改图书</button>
            <div class="btn-group">
            </div>
        </div>
        <div class="well">
            <table class="table">
                <thead>
                    <tr>
                        <th>ID</th>
                        <th>图书名字</th>
                        <th>价格</th>
                        <th>ISBN</th>
                        <th>库存量</th>
                        <th>出版日期</th>
                        <th>稿费</th>
                        <th>责任编辑</th>
                        <th>书类</th>
                        <th style="width: 26px;"></th>
                    </tr>
                </thead>
                <tbody>
                    @for (int i = 0; i < book.Count; i++)
                    {
                        <tr>
                            <td>@book[i].Id</td>
                            <td><a href="#detail">@book[i].Name</a></td>
                            <td>@book[i].Price</td>
                            <td>@book[i].Isbn</td>
                            <td>@book[i].Inventory</td>
                            <td>@book[i].PublicationDate</td>
                            <td>@book[i].Fee</td>
                            <td>@book[i].Editor</td>
                            <td>@book[i].Type</td>
                            <td>
                                <a href="#editModal" role="button" data-toggle="modal"><i class="icon-pencil"></i></a>
                                <a href="#delModal" role="button" data-toggle="modal"><i class="icon-remove"></i></a>
                            </td>
                        </tr>

                    }

                </tbody>
            </table>
        </div>
        <div class="pagination">
            <ul>
                <li><a href="#">Prev</a></li>
                <li><a href="#">1</a></li>
                <li><a href="#">2</a></li>
                <li><a href="#">3</a></li>
                <li><a href="#">4</a></li>
                <li><a href="#">Next</a></li>
            </ul>
        </div>

        <div class="modal small hide fade" id="delModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h3 id="myModalLabel">删除图书</h3>
            </div>
            <div class="modal-body">
                <p class="error-text"><i class="icon-warning-sign modal-icon"></i>确定删除这本书的信息</p>
            </div>
            <div class="modal-footer">
                <button class="btn" data-dismiss="modal" aria-hidden="true">取消</button>
                <button class="btn btn-danger" id="delete-button" data-dismiss="modal">删除</button>
            </div>
        </div>

        <div class="modal small hide fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h3 id="myModalLabel">本书详情</h3>
            </div>
            <div class="modal-body">
                <form id="tabbook" method="post" >
                    <input type="text" name="bookname" value="bookname" class="input-xlarge">
                    <input type="text" name="bookprice" value="bookprice" class="input-xlarge auth1" />
                    <input type="text" name="bookcontext" value="bookcontext" class="input-xlarge auth1">
                    <div class="btn-toolbar">
                        <button class="btn btn-primary" id="save-button" type="submit"><i class="icon-save"></i>保存</button>
                        <button class="btn btn-primary" asp-action="Home"><i class="icon-backward"></i>返回</button>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button class="btn" data-dismiss="modal" aria-hidden="true">取消</button>
                <button class="btn btn-danger" id="delete-button" data-dismiss="modal">删除</button>
            </div>
        </div>

    </div>
</div>


